package com.flxz.forum.service.impl;

import java.util.List;
import com.flxz.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.flxz.forum.mapper.ForumReportMapper;
import com.flxz.forum.domain.ForumReport;
import com.flxz.forum.service.IForumReportService;

/**
 * 讨论举报Service业务层处理
 * 
 * @author fl
 * @date 2025-09-14
 */
@Service
public class ForumReportServiceImpl implements IForumReportService 
{
    @Autowired
    private ForumReportMapper forumReportMapper;

    /**
     * 查询讨论举报
     * 
     * @param reportId 讨论举报主键
     * @return 讨论举报
     */
    @Override
    public ForumReport selectForumReportByReportId(Long reportId)
    {
        return forumReportMapper.selectForumReportByReportId(reportId);
    }

    /**
     * 查询讨论举报列表
     * 
     * @param forumReport 讨论举报
     * @return 讨论举报
     */
    @Override
    public List<ForumReport> selectForumReportList(ForumReport forumReport)
    {
        return forumReportMapper.selectForumReportList(forumReport);
    }

    /**
     * 新增讨论举报
     * 
     * @param forumReport 讨论举报
     * @return 结果
     */
    @Override
    public int insertForumReport(ForumReport forumReport)
    {
        forumReport.setCreateTime(DateUtils.getNowDate());
        return forumReportMapper.insertForumReport(forumReport);
    }

    /**
     * 修改讨论举报
     * 
     * @param forumReport 讨论举报
     * @return 结果
     */
    @Override
    public int updateForumReport(ForumReport forumReport)
    {
        return forumReportMapper.updateForumReport(forumReport);
    }

    /**
     * 批量删除讨论举报
     * 
     * @param reportIds 需要删除的讨论举报主键
     * @return 结果
     */
    @Override
    public int deleteForumReportByReportIds(Long[] reportIds)
    {
        return forumReportMapper.deleteForumReportByReportIds(reportIds);
    }

    /**
     * 删除讨论举报信息
     * 
     * @param reportId 讨论举报主键
     * @return 结果
     */
    @Override
    public int deleteForumReportByReportId(Long reportId)
    {
        return forumReportMapper.deleteForumReportByReportId(reportId);
    }
}
